package com.project.bean;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;
import java.util.List;

public class PostBean {
    private  int id; //id
    private  String title;  //主题
    private  String content;  //内容
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime date=LocalDateTime.now();

    /**
     * 频道
     */
    private  TypeBean type;
    private  UserBean user;
    private List<ReplyBean> replyList;
    /**
     * 回帖数量
     */
    private  int replyNum;

    @Override
    public String toString() {
        return "PostBean{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", date=" + date +
                ", type=" + type +
                ", user=" + user +
                ", replyList=" + replyList +
                ", replyNum=" + replyNum +
                "}\n";
    }

    public PostBean(String title, String content, int typeId, int userId) {
        this.title = title;
        this.content = content;
        this.type = new TypeBean();
        type.setId(typeId);
        this.user = new UserBean();
        user.setId(userId);
    }

    public PostBean() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDateTime getDate() {
        return date;
    }

    public void setDate(LocalDateTime date) {
        this.date = date;
    }

    public TypeBean getType() {
        return type;
    }

    public void setType(TypeBean type) {
        this.type = type;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public List<ReplyBean> getReplyList() {
        return replyList;
    }

    public void setReplyList(List<ReplyBean> replyList) {
        this.replyList = replyList;
    }

    public int getReplyNum() {
        return replyNum;
    }

    public void setReplyNum(int replyNum) {
        this.replyNum = replyNum;
    }
}
